<?php
// Tim'Roster
// Copyright (c) 2011 Nicolas Nallet <aspgic2@gmail.com>
//
// This file is part of Tim'Roster.
//
// Tim'Roster is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Tim'Roster is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

class Enum_Item_Type{

    const HARVESTED_ITEM_TYPE_ID = 1;
    const HARVESTED_ITEM_TYPE_LABEL = 'harvested';

    const LOOTED_ITEM_TYPE_ID = 2;
    const LOOTED_ITEM_TYPE_LABEL = 'looted';

    const CRAFTED_ITEM_TYPE_ID = 3;
    const CRAFTED_ITEM_TYPE_LABEL = 'crafted';
    
    const ELEVATION_CRYSTAL_ITEM_TYPE_ID = 4;
    const ELEVATION_CRYSTAL_ITEM_TYPE_LABEL = 'elevation crystal';

    /**
     * (PHP 5)<br/>
     * Convert item type id to item type label
     * @param int $value
     * @return int
     */
    public static function convert_id_to_label($value){
        switch ($value){

            case Enum_Item_Type::HARVESTED_ITEM_TYPE_ID :
                return Enum_Item_Type::HARVESTED_ITEM_TYPE_LABEL;

            case Enum_Item_Type::LOOTED_ITEM_TYPE_ID :
                return Enum_Item_Type::LOOTED_ITEM_TYPE_LABEL;

            case Enum_Item_Type::ELEVATION_CRYSTAL_ITEM_TYPE_ID :
                return Enum_Item_Type::ELEVATION_CRYSTAL_ITEM_TYPE_LABEL;

            case Enum_Item_Type::CRAFTED_ITEM_TYPE_ID :
            default : 
                return Enum_Item_Type::CRAFTED_ITEM_TYPE_LABEL;
        }
    }
}
?>